﻿using System.Collections.Generic;

namespace QuickTuner.RadioProtocol
{
    public partial class ProtocolAction
    {
        private string _module;
        private string _action;
        private string _paramString;
        private IDictionary<string, string> _params;

        /// <summary>
        /// The target module
        /// </summary>
        public string Module { get { return _module; } set { _module = value; } }

        /// <summary>
        /// The target action
        /// </summary>
        public string Action { get { return _action; } set { _action = value; } }

        /// <summary>
        /// A string that contains the whole parameters after the question mark.
        /// </summary>
        public string ParameterString { get { return _paramString; } set { _paramString = value; } }

        /// <summary>
        /// A name-value dictionary containing all parameters parsed
        /// </summary>
        public IDictionary<string, string> Parameters { get { return _params; } set { _params = value; } }


        // constructors _________________________________________________________________

        public ProtocolAction() : this(null, null, null, null) {}

        public ProtocolAction(string module, string action,
            string paramsString, IDictionary<string, string> paramsDict)
        {
            _module = module;
            _action = action;
            _paramString = paramsString;
            _params = paramsDict;
        }
    }
}